package com.eastcom.bm.service.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.eastcom.bm.atom.Atom_KpiDefine;
import com.eastcom.bm.dao.DAOFactory;
import com.eastcom.bm.dao.IKpiDefineDao;
import com.eastcom.bm.service.IKpiDefineService;
import com.eastcom.common.db.JDBCTemplate;
import com.eastcom.providor.BMSetting;

public class KpiDefineService implements IKpiDefineService {

	private static Logger log = BMSetting.getBMlog();

	public List<Atom_KpiDefine> getAllKpiDefine() {
		try{
			IKpiDefineDao kpiDao=DAOFactory.getInstance().getKpiDefineDao();
			return kpiDao.getAllKpiDefine();
		}
		catch(Exception e){
			log.error("IKpiDefineService getAllKpiDefine error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

	public List<Atom_KpiDefine> selectKpiDefineByDataSetId(String dataSetId) {
		try{
			IKpiDefineDao kpiDao=DAOFactory.getInstance().getKpiDefineDao();
			return kpiDao.selectKpiDefineByDataSetId(dataSetId);
		}
		catch(Exception e){
			log.error("IKpiDefineService selectKpiDefineByDataSetId error", e);
		}
		finally{
			JDBCTemplate.doSessionFinally();
		}
		
		return null;
	}

}
